import request from '@/utils/request'

export function list(query) {
  return request({
    url: '/system/collect/list',
    method: 'get',
    params: query
  })
}


export function indexCreateTimeChange(query) {
  return request({
    url: '/system/collect/indexCreateTimeChange',
    method: 'get',
    params: query
  })
}

// 考勤汇总
export function attendanceList(query) {
  return request({
    url: '/system/collect/attendanceList',
    method: 'get',
    params: query
  })
}

// 绩效汇总
export function performanceList(query) {
  return request({
    url: '/system/collect/performanceList',
    method: 'get',
    params: query
  })
}

// 奖金汇总
export function subsidyList(query) {
  return request({
    url: '/system/collect/subsidyList',
    method: 'get',
    params: query
  })
}

// 社保公积金汇总
export function socialSecurityList(query) {
  return request({
    url: '/system/collect/socialSecurityList',
    method: 'get',
    params: query
  })
}

// 提成汇总
export function royaltiesList(query) {
  return request({
    url: '/system/collect/royaltiesList',
    method: 'get',
    params: query
  })
}

// 个税汇总
export function taxList(query) {
  return request({
    url: '/system/collect/taxList',
    method: 'get',
    params: query
  })
}


// 修改月工资汇总
export function updateIndex(data) {
  return request({
    url: '/system/collect/updateIndex',
    method: 'put',
    data: data
  })
}

// 修改考勤
export function updateAttendance(data) {
  return request({
    url: '/system/collect/updateAttendance',
    method: 'put',
    data: data
  })
}

// 修改绩效
export function updatePerformance(data) {
  return request({
    url: '/system/collect/updatePerformance',
    method: 'put',
    data: data
  })
}

// 修改补贴
export function updateSubsidy(data) {
  return request({
    url: '/system/collect/updateSubsidy',
    method: 'put',
    data: data
  })
}

// 修改社保公积金
export function updateSocialSecurity(data) {
  return request({
    url: '/system/collect/updateSocialSecurity',
    method: 'put',
    data: data
  })
}

// 修改提成
export function updateRoyalties(data) {
  return request({
    url: '/system/collect/updateRoyalties',
    method: 'put',
    data: data
  })
}

// 修改个税
export function updateTax(data) {
  return request({
    url: '/system/collect/updateTax',
    method: 'put',
    data: data
  })
}


// 核算工资
export function payrollAccounting(data) {
  return request({
    url: '/system/collect/payrollAccounting',
    method: 'post',
    data: data
  })
}


// 工资条
export function salarySheetList(query) {
  return request({
    url: '/system/collect/salarySheetList',
    method: 'get',
    params: query
  })
}

export function getTableHead() {
  return request({
    url: '/system/collect/getTableHead' ,
    method: 'get'
  })
}

export function getTableHeadList(fieldsIds) {
  return request({
    url: '/system/collect/getTableHeadList/' + fieldsIds,
    method: 'get'
  })
}


export function updateGrantStatus(cId) {
  return request({
    url: '/system/collect/updateGrantStatus/' + cId,
    method: 'put'
  })
}


export function updateStatus(cId) {
  return request({
    url: '/system/collect/updateStatus/' + cId,
    method: 'put'
  })
}
